"""
生成器：语法简化升级版的迭代器
"""


def fib(num):
    a, b = 0, 1
    for _ in range(num):
        a, b = b, a + b
        yield a


it = fib(20)
for value in it:
    print(value)
